//
//  LFBHomeHeaderView.m
//  loveFreshBeen
//
//  Created by Feng on 2017/7/9.
//  Copyright © 2017年 feng. All rights reserved.
//

#import "LFBHomeHeaderView.h"
#import "LFBCycleView.h"
#import "LFBIconView.h"

#define ScreenWidth     ([UIScreen mainScreen].bounds.size.width)
#define ScreenHeight    ([UIScreen mainScreen].bounds.size.height)

@interface LFBHomeHeaderView ()

@property(nonatomic,weak) LFBCycleView *cycleView;
@property(nonatomic,weak) LFBIconView *iconView;

@end

@implementation LFBHomeHeaderView

+ (instancetype)createHeaderView
{
    return [[self alloc] initWithFrame:[UIScreen mainScreen].bounds];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    NSLog(@"~~~~~~创建LFBHomeHeaderView");
    
    LFBCycleView *cycleView = [[LFBCycleView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 180)];
    self.cycleView = cycleView;
    cycleView.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:cycleView];
    
    LFBIconView *iconView = [[LFBIconView alloc] initWithFrame:CGRectMake(0, 180, ScreenWidth, 80)];
    self.iconView = iconView;
    iconView.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:iconView];
}

- (void)setFocusArray:(NSArray *)focusArray
{
    _focusArray = focusArray;
    self.cycleView.focusArray = focusArray;
}

- (void)setIconsArray:(NSArray *)iconsArray
{
    _iconsArray = iconsArray;
    self.iconView.iconsArray = iconsArray;
}

@end
